#include <iostream>
#include <algorithm>
using namespace std;
int Fibo[5010][5010] =
    {
        {1, 0},
        {1, 1},
        {1, 2}};
void add(int);
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 3; i <= n; i++)
    {
        add(i);
    }
    for (int i = Fibo[n][0]; i >= 1; i--)
    {
        cout << Fibo[n][i];
    }
    return 0;
}
void add(int n)
{
    //位
    int c = 0;
    int i;
    int len = max(Fibo[n - 1][0], Fibo[n - 2][0]);
    for (i = 1; i <= len; i++)
    {
        int sum = Fibo[n - 1][i] + Fibo[n - 2][i] + c;
        Fibo[n][i] = sum % 10;
        c = sum / 10;
    }
    if (c != 0)
    {
        Fibo[n][i] = c;
        Fibo[n][0] = i;
    }
    else
    {
        Fibo[n][0] = i - 1;
    }
}